<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix = "fn" uri = "http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<script type="text/javascript" src = "static/js/jquery.js"></script>
		<link rel="stylesheet" href="static/css/bootstrap.min.css" />
		<link rel = "stylesheet" href = "static/css/globle.css"/>
		<script type="text/javascript" src="static/js/bootstrap-dropdown.js"></script>
	<style type="text/css">
		span{
			color:black;
			font-size:1em;
		}
		a{
			color:blue;
		}
		li a{
			color:black;
		}
	</style>
		
	<title></title>
</head>
<body>
 <div class="navbar navbar-fixed-top" id = "manager">
			<div class="navbar-inner">
				<div class="container">
					<a  class = "brand" href="#">项目管理系统</a>
			
				</div>
			</div>
		 </div>
	<div class="container" style = "margin-top:60px">
		<div class="row" style = "margin-top:10px">
			<div class="span3">
				<div style="padding: 8px 0;" class="well">
					<ul class="nav nav-list">
					  <li class="nav-header">apple总部项目</li>
					  <li><a href="project.jspx?_m=project&pid=${project.p_id }"><i class=" icon-home"></i>最新动态</a></li>
					  <li class="active"><a href="#"><i class="icon-flag icon-white"></i>目标</a></li>
					  <li><a href="#"><i class="icon-folder-open"></i>资料库</a></li>
					  <li><a href ="#"><i class="icon-file"></i>文件共享</a></li>
					  <li><a href="#"><i class="icon-user"></i>联系人</a></li>
					  <li><a href="#"><i class="icon-fire"></i>想法</a></li>
					  <li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
					  <li><a href="#"><i class="icon-cog"></i>项目设置</a></li>
					</ul>
				</div>
			</div>
			<div class = "span9 btn-toolbar" style = "margin-top:18px;clear:top">
				       <div class="btn-group">
						    <button class="btn dropdown-toggle btn-primary" data-toggle="dropdown">
						    操作<span class="caret"></span>
						    </button>
						    <ul class="dropdown-menu" id = "menu1">
						    	<li><a href = "goal.jspx?_m=addGoal">添加新目标</a></li>
						    	<li><a>帮助</a></li>
						    </ul>
						</div>
					 
					 <%-- 显示此项目的所有目标--%>
				<c:if test="${fn:length(goalPager.result) == 0 }">
					<div>还没有任务，快来<a href = "goal.jspx?_m=addGoal">添加</a>吧！</div>
				</c:if>
			<c:forEach items = "${sessionScope.goalPager.result}" var = "g">
				<ul class="breadcrumb" style = "margin-top:40px;margin-bottom:0px;border-radius:3px 3px 0 0;">
						<li class = "active "> <a href="task.jspx?gid=${g.g_id }&grate=${g.g_rate}">${g.g_name}</a></li>
						<li style = "float:right"><i class = "icon-edit"></i><a href = "goal.jspx?_m=editGoal&gid=${g.g_id }">编辑</a></li>
						<li style = "float:right;margin-right:5px"><a href = "task.jspx?gid=${g.g_id }&grate=${g.g_rate}">查看所有任务</a></li>
				</ul>
					<div class = "well" style = "border-radius:0 0 3px 3px">
						<p>${g.g_dec}</p>
						<div style="margin-bottom: 5px; margin-top:10px" class="progress progress-danger">
					        <div style="width:${g.g_rate}%" class="bar">已完成${g.g_rate}%</div>
					    </div>
					</div>
			</c:forEach> 
			<c:choose>
						<c:when test="${goalPager.pagerNum != 1}">
							<a href = "goal.jspx?p=${goalPager.pagerNum -1 }">上一页</a>
						</c:when>
						<c:otherwise>
							<span>上一页</span>
						</c:otherwise>
						
					</c:choose>
					<c:choose>
						<c:when test="${goalPager.pagerNum < goalPager.totalPages }">
							<a href = "goal.jspx?p=${goalPager.pagerNum + 1 }">下一页</a>
						</c:when>
						<c:otherwise>
							<span>下一页</span>
						</c:otherwise>
					</c:choose>
				
			</div>
		</div>
	</div>
	<script type="text/javascript">
		$(".dropdown-toggle").dropdown();
	</script>
</body>
</html>